<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 在promise的then方法内返回新的promise对象，并改变状态

        new Promise(resolve => {
            setTimeout(() => {
                resolve("报名成功");
            }, 1000)
        }).then(value => {
            console.log(value);
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    resolve("学习");
                }, 1000)
            })
        }).then(value => {
            console.log(value);
            return new Promise((resolve,rej) => {
                setTimeout(() => {
                    resolve("整理简历");
                }, 1000)
            })
        }).then(value => {
            console.log(value);
            return new Promise(resolve => {
                setTimeout(() => {
                    resolve("面试");
                }, 1000)
            })
        }).then(value => {
            console.log(value);
            return new Promise(resolve => {
                setTimeout(() => {
                    resolve("上班");
                }, 1000)
            })
        }).then(value => {
            console.log(value);
        }).catch(reason => {
            console.log('错误了',reason);
        })
    </script>
</body>

</html>